package cn.com.blueInfo.business.ddns.entity;

import cn.com.blueInfo.config.YamlFileLoader;
import lombok.Data;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Data
@ToString
@Component
@PropertySource(value = "classpath:config/business.yml", factory = YamlFileLoader.class)
@ConfigurationProperties(prefix = "business.ddns")
public class DDNSParams {

    private boolean enabled;
    private String service;
    private Integer ttl;
    private AliYun aliyun;
    private TencentCloud tencentCloud;
    private Ipv4 ipv4;
    private Ipv6 ipv6;

    @Data
    public static class AliYun {
        private String accessKeyId;
        private String accessKeySecret;
    }

    @Data
    public static class TencentCloud {
        private String secretId;
        private String secretKey;
    }

    @Data
    public static class Ipv4 {
        private String[] domains;
        private String[] address;
    }

    @Data
    public static class Ipv6 {
        private String[] domains;
        private String[] address;
    }

}
